<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace AlibabaCloud\Client\Traits;

trait HasDataTrait
{
    protected $dot;
    public function search($expression)
    {
        return \JmesPath\Env::search($expression, $this->dot->all());
    }
    public function clear($keys = NULL)
    {
        $this->dot->clear($keys);
    }
    public function flatten($delimiter = ".", $items = NULL, $prepend = "")
    {
        return $this->dot->flatten($delimiter, $items, $prepend);
    }
    public function get($key = NULL, $default = NULL)
    {
        return $this->dot->get($key, $default);
    }
    public function set($keys, $value = NULL)
    {
        $this->dot->set($keys, $value);
    }
    public function isEmpty($keys = NULL)
    {
        return $this->dot->isEmpty($keys);
    }
    public function setReference(array &$items)
    {
        $this->dot->setReference($items);
    }
    public function toJson($key = NULL, $options = 0)
    {
        return $this->dot->toJson($key, $options);
    }
    public function toArray()
    {
        return $this->dot->all();
    }
    public function offsetExists($key)
    {
        return $this->dot->has($key);
    }
    public function offsetGet($key)
    {
        return $this->dot->offsetGet($key);
    }
    public function offsetSet($key, $value)
    {
        $this->dot->offsetSet($key, $value);
    }
    public function offsetUnset($key)
    {
        $this->delete($key);
    }
    public function delete($keys)
    {
        $this->dot->delete($keys);
    }
    public function count($key = NULL)
    {
        return $this->dot->count($key);
    }
    public function getIterator()
    {
        return $this->dot->getIterator();
    }
    public function jsonSerialize()
    {
        return $this->dot->jsonSerialize();
    }
    public function __get($name)
    {
        if(!isset($this->all()[$name])) {
            return NULL;
        }
        return json_decode(json_encode($this->all()))->{$name};
    }
    public function all()
    {
        return $this->dot->all();
    }
    public function __set($name, $value)
    {
        $this->add($name, $value);
    }
    public function add($keys, $value = NULL)
    {
        $this->dot->add($keys, $value);
    }
    public function __isset($name)
    {
        return $this->has($name);
    }
    public function has($keys)
    {
        return $this->dot->has($keys);
    }
    public function __unset($name)
    {
        $this->delete($name);
    }
    protected function dot(array $data = [])
    {
        $this->dot = new \Adbar\Dot($data);
    }
}

?>